<html>
<head>
<title>REGISTER</title>
<meta charset='utf-8'/>
<script lang="javascript">
function check_user(str)
{
    var xlmhttp;
    if(window.XMLHttpRequest) xmlhttp=new XMLHttpRequest();
    else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.onreadystatechange=function()
    {
        if(xmlhttp.readyState==4 && xmlhttp.status==200&&xmlhttp.responseText!='true') 
        {
            register_form.guidangky.disabled=true;
            document.getElementById("button_s").innerHTML=xmlhttp.responseText;
        }
        else 
        {
           document.getElementById("button_s").innerHTML="<font color='green'>Bạn có thể sử dụng tên đăng nhập này</font>"
           register_form.guidangky.disabled=false;
        }
    }
    xmlhttp.open("get","check user.php?id="+str,true);
    xmlhttp.send();
}

</script>
</head>
<form action="checkregister.php" method="post" name="register_form">
ID:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input type='text' name="id" onkeyup="check_user(this.value);"/><span id="button_s"></span><br />
Password:&nbsp; &nbsp; &nbsp;&nbsp; <input type='password' name="pass"/><br />
Re-Password: <input type='password' name="repass"/><br />
<input type="submit" value="Gửi đăng ký" name="guidangky" disabled=""/>
</form> 
</html>